
QSI, INC: Dispatch #:<?php echo $model->dispatch;?> has been setup for automatic alerts!

*************************************************************************

Location: <?php echo $model->locno; ?>

    <?=$model->customer->firstname;?>
    <?=$model->customer->lastname . "\n";?>
    <?=$model->Location->locname . "\n";?>
    <?=$model->Location->add1 . "\n"?>
    <?=$model->Location->city;?> <?=$model->Location->zip;?> <?=$model->Location->state;?>

    QSI Engineer:  <?php
    $errorFlag = false;

    $tech = $model->lastestTech;
    if (empty($tech)) {
        $errorFlag = true;
    } else {
        $employee = Employees::model()->findByPk($tech->empno);
        if (empty($employee)) $errorFlag = true;
    }
    if (!$errorFlag):
        echo "$employee->firstname $employee->lastname" ?>
        <?php endif; ?>
    Status: <?php
    if (!empty($model->lastestTech->status)) echo $model->lastestTech->status;
    ?>

    *************************************************************************

Notes:
    <?= $model->notes . "\n" ?>
    Notes added by Customer
    <?php
    $crit = new CDbCriteria();
    $crit->condition = 'dispatch=:dispatch and empno IS NULL';
    $crit->params = array(
        'dispatch' => $model->dispatch,
    );
    $custNotes = Notes::model()->findAll($crit);
    foreach ($custNotes as $note):
        ?>
Added on <?= $note->dateofnote . "\n" ; ?>
<?= $note->note . "\n" ?>
        <?php endforeach; ?>

    <?php
    $crit = new CDbCriteria();
    $crit->condition = "dispatch=:dispatch and custno IS NULL and private IS NULL or private !='1'";
    $crit->params = array(
        'dispatch' => $model->dispatch,
    );
    $techNotes = Notes::model()->findAll($crit);
    foreach ($techNotes as $note):
        echo   "\n";
        ?>
        Notes added by QSI Engineer: <?= Employees::getEmployeeName($note->empno)
        ; ?> on <?= $note->dateofnote . "\n"
        ; ?>

        <?= $note->note . "\n" ?>
        <?php endforeach; ?>


    *************************************************************************

Best Regards,

QSI, INC
502-350-1000
